package com.lmf.cloud.controller;

import com.lmf.cloud.resp.ResultData;
import com.lmf.cloud.service.TStorageService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author LiuMingFu
 * @since 2024-08-01
 */
@RestController
@RequestMapping("/t-storage")
public class TStorageController {

    @Resource
    private TStorageService tStorageService;

    /**
     * 扣减库存
     *
     * @param productId 产品id
     * @param count     数量
     * @return
     * @author LiuMingFu
     * @date 2024/8/1
     */
    @RequestMapping("/decreaseStorage")
    public ResultData<Boolean> decreaseStorage(Long productId, Integer count) {
        return tStorageService.decreaseStorage(productId, count);
    }

}
